package net.pinnoocle.playcommon.password;

import net.pinnoocle.playcommon.utils.EncryptUtils;

/**
 * 密码工具类
 *
 * @author ye
 * @Description
 * @create 2021-09-02 16:19
 */
public class Sha512PasswordEncoder implements PasswordEncoder {

  @Override
  public String encode(CharSequence rawPassword) {
    return EncryptUtils.sha512((String) rawPassword);
  }

  @Override
  public boolean matches(CharSequence rawPassword, String encodedPassword) {
    return this.encode(rawPassword).equals(encodedPassword);
  }
}
